home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.0 KB | 113 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: PRIcon.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef PRICON_H
- #define PRICON_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef SLGRDEF_H
- #include "SLGrDef.h"
- #endif
-
- #ifndef SLPTRECT_H
- #include "SLPtRect.h"
- #endif
-
- #ifndef PRGRREF_H
- #include "PRGrRef.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_OResourceFile;
-
- class FW_CReadableStream;
- class FW_CWritableStream;
-
- struct FW_SGraphicContext;
-
- //========================================================================================
- // class FW_CPrivIconRep
- //========================================================================================
-
- class FW_CPrivIconRep : public FW_CPrivGrRefObj
- {
- public:
- FW_DECLARE_AUTO(FW_CPrivIconRep)
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CPrivIconRep(FW_PlatformIcon platformIcon);
- FW_CPrivIconRep(FW_OResourceFile* resourceFile,
- FW_ResourceID resID,
- short size);
-
- FW_CPrivIconRep(const FW_CPrivIconRep& rep);
-
- ~FW_CPrivIconRep();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Streaming -----
-
- FW_CPrivIconRep(FW_CReadableStream& stream);
- void Write(FW_CWritableStream& stream) const;
-
- FW_Boolean IsEqual(const FW_CPrivIconRep* other) const;
-
- // ----- Get, Set, Adopt and Orphan -----
-
- FW_PlatformIcon GetPlatformIcon() const;
- FW_PlatformIcon OrphanPlatformIcon();
- FW_Boolean IsPlatformIconOrphan() const;
-
- void SetPlatformIcon(FW_PlatformIcon newIcon);
- void AdoptPlatformIcon(FW_PlatformIcon newIcon);
-
- // ---- Geometry -----
- void GetIconSize(FW_SPoint& size) const; // Size in pixels
- void GetIconSize(Environment* ev,
- FW_SGraphicContext& gc,
- FW_SPoint& size) const; // Size in gc units
-
- //----------------------------------------------------------------------------------------
- // Implementation
- //
- protected:
- void DisposePlatformIcon();
-
- static FW_PlatformIcon CopyPlatformIcon(FW_PlatformIcon icon);
- static short GetPlatformIconSize(FW_PlatformIcon icon);
-
- private:
- FW_Boolean fOwnIcon;
- FW_PlatformIcon fPlatformIcon;
- short fMaxIconSize;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CPrivIconRep::GetPlatformIcon
- //----------------------------------------------------------------------------------------
-
- inline FW_PlatformIcon FW_CPrivIconRep::GetPlatformIcon() const
- {
- return fPlatformIcon;
- }
-
- #endif // PRICON_H
-